
const { query } = require('../db/mysql')

class Site {
  constructor () {
    this.tableName = 'site_config'
  }

  getSiteConfigByName (params = {}) {
    const sql = `SELECT ${this.tableName}.name, ${this.tableName}.val
                   FROM ${this.tableName}
                     WHERE ${this.tableName}.name = ?`
    return query(sql, [params.name])
  }

}

module.exports = new Site()
